/*
	二分查找算法
	前提:是一个有序的数值
*/
int birnarySearch(ElemType *S, int left, int right, ElemType key)
{
	int mid = (right - left)/2;

	if (S[mid] == key)
		return mid;
	else if (S[mid] < key)
		return birnarySearch(S, mid+1, right, key);
	else
		return birnarySearch(S, left, mid-1);
}